home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / dmedia / sfkeywords.z / sfkeywords
Text File  |  1998-10-30  |  12KB  |  265 lines

  1.  
  2.  
  3.  
  4. ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))                                                    ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      sfkeywords - soundfile keywords used in sfinfo, sfplay, and sfconvert
  10.  
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      Many of the sf programs require descriptions of soundfile formats.  These
  14.      descriptions are always specified using the same set of keywords, which
  15.      are given one after the other on the command line, separated by spaces.
  16.  
  17.           byteorder e    endian (e is big or little)
  18.           channels n     n-channel file (1 or 2)
  19.           rate r         sampling rate r, in Hertz
  20.           format f       file format f (see below)
  21.           integer n s    n-bit integer file, where s is:
  22.                               2scomp: 2's complement signed data
  23.                               unsigned: unsigned data
  24.           float m        floating point file, maxamp m (usually 1.0)
  25.           mulaw          mulaw file (8-bit only)
  26.           dataoff o      data starts at byte offset o (for raw data)
  27.  
  28.      The keywords do not need to be spelled out; only the first character, or
  29.      the first 2 characters for 'float' and 'format', is required.
  30.  
  31.  
  32. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  33.      These keywords are used in situations where information about a soundfile
  34.      format is needed, such as in sfconvert:
  35.  
  36.           sfconvert in.snd out.aif format aiff integer 16 2 chan 2
  37.  
  38.      Specifies a stereo, 16-bit (2's complement signed) integer aiff file.
  39.  
  40.      Note that some keywords, such as 'integer', require parameters.  These
  41.      parameters can also be abbreviated, except for the parameter of the
  42.      'format' keyword.
  43.  
  44.      The 'format' keyword specifies the file format.  Currently supported file
  45.      formats are:
  46.  
  47.           aiff    Audio Interchange File Format
  48.           aifc    AIFF-C File Format
  49.           next    NeXT/Sun Format
  50.           wave    MS RIFF WAVE Format
  51.  
  52.      The 'channels' and 'rate' keywords are fairly straightforward.  They
  53.      simply specify how many interleaved channels of data the soundfile has
  54.      and what sampling rate the data is meant to be played at (in Hertz).
  55.  
  56.      Here are some notes on sampling rates:
  57.  
  58.      Some files, particularly mulaw-encoded 8-bit NeXT soundfiles, have a
  59.      sampling rate of 8012.8210513 Hz, which is often abbreviated to 8012.82
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))                                                    ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))
  71.  
  72.  
  73.  
  74.      Hz or 8.013 kHz.  When converting another file to a file with this
  75.      sampling rate, you should be sure to specify the full-precision rate.
  76.      Otherwise some programs may not recognize the file as playable.  WAVE
  77.      files store sampling rate as an integral number of samples per second,
  78.      therefore they cannot support this sampling rate.
  79.  
  80.      The sfconvert and soundfiler utilities will perform high-quality linear
  81.      phase sampling rate conversion between the standard rates 8000, 11025,
  82.      16000, 22050, 32000, 44100, and 48000 Hz.  For conversions where the
  83.      source or target rate is not one of these standard rates, sfconvert and
  84.      soundfiler use a lower-quality algorithm, and issue a warning to this
  85.      effect.  For these lower-quality conversions, some loss of quality is
  86.      likely, and audible artifacts may occur in the output sound, especially
  87.      on conversions from a higher to a lower sampling rate.  This lower
  88.      quality algorithm, which was present in earlier releases, uses third-
  89.      order polynomial interpolation and does marginal anti-aliasing.  A high-
  90.      quality algorithm capable of conversion between arbitrary pairs of
  91.      sampling rates is under development.
  92.  
  93.      In order to allow high-quality rate conversion in fairly common cases, if
  94.      you attempt to convert an 8012.8210513 Hz soundfile to a soundfile with
  95.      any standard rate except 8000 Hz, sfconvert and soundfiler will assume
  96.      the input rate is 8000 Hz and perform the conversion, again issuing a
  97.      warning to this effect.  If the -0.16 % shift in pitch (less than three
  98.      hundredths of a semitone) is not acceptable, you can first convert the
  99.      8012.8210513 Hz soundfile into a 8000 Hz soundfile and then convert the
  100.      8000 Hz soundfile to another standard rate, as in the following:
  101.  
  102.           sfconvert in.aiff  temp.aiff rate 8000
  103.           sfconvert temp.aiff out.aiff rate 16000
  104.  
  105.      In this case sfconvert and soundfiler will use the older algorithm, which
  106.      is of acceptable quality for small changes in sampling rate, to do the
  107.      first conversion, and the new algorithm to do the second conversion with
  108.      the best quality.
  109.  
  110.      The dual of the previous conversion is possible with a similar procedure.
  111.      You may convert from any standard rate to 8012.8210513 Hz by first
  112.      converting to 8000 Hz, and then to 8012.8210513 Hz:
  113.  
  114.           sfconvert in.aiff  temp.aiff rate 8000
  115.           sfconvert temp.aiff out.aiff rate 8012.8210513
  116.  
  117.  
  118.      The 'integer', 'float', and 'mulaw' keywords are mutually exclusive
  119.      (although no error will be reported if you use more than 1).  Each
  120.      specifies the encoding format of the actual samples themselves:
  121.  
  122.      - an 'integer' soundfile stores sound information as simple unsigned or
  123.      2's complement 1-32 bit integers.  In the signed case, 0 is the zero
  124.      signal level.  In the unsigned case, (2^b)/2 is the zero signal level,
  125.      where b is the number of bits per integer.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))                                                    ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))
  137.  
  138.  
  139.  
  140.      - a 'mulaw' soundfile, which for these programs must be in 8-bit format,
  141.      stores companded 13-bit sample values in an 8-bit, unsigned-like format.
  142.      If you play a mulaw file using sfplay, its samples are automatically
  143.      converted to 16-bit samples which the audio hardware can output.
  144.  
  145.      - a 'float' soundfile consists of IEEE standard floating point numbers.
  146.      Generally, -1.0 represents full negative amplitude and 1.0 represents
  147.      full positive amplitude, but it is quite possible to generate a soundfile
  148.      with sample values of magnitude greater than 1.0.  For this reason, the
  149.      'float' keyword takes an argument as to what value should be treated as
  150.      full maximum amplitude.  This is usually 1.0.  If you play a floating
  151.      point file using sfplay, its sample values are automatically scaled based
  152.      on a 1.0 maxamp and converted to 24-bit integers which the audio hardware
  153.      can output.
  154.  
  155.      When converting floating point data to integer data and vice versa, the
  156.      sf programs always assume that the highest positive value ((2^b)/2-1 for
  157.      b-bit 2's complement integers) maps to the floating point maximum
  158.      amplitude, usually 1.0.  For example, when converting 16-bit 2's
  159.      complement integers to floats of maximum amplitude 1.0, 32767 will map to
  160.      +1.0, and -32767 will map to -1.0.  This was done so that it is possible
  161.      to convert a floating point file to an integer file without clipping a
  162.      value off the positive end of the integral range.  This means that when
  163.      converting ints to floats, it is possible that there will be one value in
  164.      the output file that is less than -maxamp where maxamp is the maximum
  165.      amplitude specified after the 'float' keyword.  If this is a problem, use
  166.      a slightly different maximum amplitude which puts all output values
  167.      inside the actual desired maximum amplitude.
  168.  
  169.      The 'byteorder' keyword specifies the byte ordering (endian) of the data.
  170.      This only applies to > 8 bit data, and is currently only consulted for
  171.      integer data.  Integer data can be big endian, meaning it conforms to SGI
  172.      MIPS / Motorola byte ordering, or it can be little endian, meaning it
  173.      conforms to Intel byte ordering.  All formats supported by the sf
  174.      programs use big endian except WAVE.  Any >8 bit raw file transferred
  175.      to/from a PC should be converted to/from little endian (respectively).
  176.      For UNIX and Macintosh (t.m.)  files, big endian data is almost always
  177.      desired, and it is the default.  Note that little endian floating point
  178.      representations are currently not supported.  In the soundfiler program,
  179.      big endian is always assumed for raw data, AIFF, and AIFF-C, and little
  180.      endian is assumed for WAVE.
  181.  
  182.      The 'dataoff' keyword is used only when specifying the format of raw
  183.      data.  This feature can be useful if you have a file which contains some
  184.      sound data that starts somewhere in the middle of the file.  The offset
  185.      is given in bytes from the beginning of the file.
  186.  
  187.      The 'dataoff' keyword can be used to convert or play a soundfile in a
  188.      format that the sf programs do not recognize, if the offset of the sound
  189.      data can be determined.  It would then be possible to convert the file to
  190.      an aiff or other file which is more easily manipulated on Silicon
  191.      Graphics machines.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))                                                    ssssffffkkkkeeeeyyyywwwwoooorrrrddddssss((((1111))))
  203.  
  204.  
  205.  
  206. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  207.      Some keywords only make sense in certain contexts:
  208.  
  209.      - 'channels', 'rate', 'integer', 'float', 'mulaw' can be used anywhere.
  210.  
  211.      - 'format' does not make sense when describing the format of raw
  212.      (headerless) data.  Its purpose is to specify which type of header (aiff,
  213.      next, wave, etc.)  to format the file with.
  214.  
  215.      - 'dataoff' only makes sense when describing raw data, since the offset
  216.      of the sound data is known for soundfiles which have headers.
  217.  
  218.  
  219. BBBBUUUUGGGGSSSS
  220.      See the above discussion about rate conversion for an important note
  221.      about conversion to/from a nonstandard rate (standard rates are those
  222.      which appear on the Audio Control Panel).
  223.  
  224.      Note that no dithering is done on conversions from integers of higher
  225.      resolution to lower resolution.  This will be amended in a future
  226.      release.
  227.  
  228.      There should be a 'datasize' keyword to use with 'dataoff' when
  229.      converting a soundfile of an unsupported format to a playable file.  This
  230.      is coming.  Currently sfconvert assumes that the sound data continues to
  231.      the end of the file.
  232.  
  233.  
  234. AAAAUUUUTTTTHHHHOOOORRRR
  235.      Silicon Graphics Inc.; Apple Computer, Inc. for AIFF code.
  236.  
  237.  
  238. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  239.      intro(3a) for more about the  audio  library.  sfplay(1), sfinfo(1),
  240.      sfconvert(1), soundfiler(1).
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.